<template>
  <div>新增医生信息

      <el-form :model="add" title="添加医生"> <br/>
                <el-form-item label="">医生姓名：
                    <el-input v-model="add.doctorName" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                 <el-form-item label="">医生头像：
                    <el-input v-model="add.img" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">院区：
                   <el-select v-model="add.campusName" placeholder="请选择" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.campusName"
                    :value="item.id">
                    </el-option>
                </el-select>
              </el-form-item>
                 <el-form-item label="">职称：
                    <el-input v-model="add.jobTitle" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">科室：
                   <el-select v-model="add.divisionName" placeholder="请选择" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.divisionName"
                    :value="item.id">
                    </el-option>
                </el-select>
              </el-form-item>
                 <el-form-item label="">标签：
                    <el-input v-model="add.labels" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">挂号费：
                    <el-input v-model="add.registration" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-form-item label="">诊查费：
                    <el-input v-model="add.indagation" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                 <el-form-item label="">医生简介：
                    <el-input v-model="add.introduction" placeholder="请输入内容" style="width: 500px"></el-input>
                </el-form-item>
                <el-button @click="addDoctor()" type="primary">确定</el-button>
                <el-button @click="quxaio()" type="primary">取消</el-button>
              </el-form>
  </div>
</template>

<script>
export default {
    created(){
        this.option();
    },
    data(){
        return{
            options:{},
            add:{doctorName:'',img:'',campusName:'',jobTitle:'',divisionName:'',labels:'',introduction:'',registration:'',indagation:''},
        }
    },
    methods:{
        option(){
        this.$axios.get("/user/user/doctor/ren/findDoctorAll").then((res) => {
            console.log(res.data.data.list);
            this.options = res.data.data.list;
            })
        },
        addDoctor(){
            this.$axios.post("/user/user/doctor/ren/addDoctor",this.add).then(res=>{
                this.add={};
                this.$router.push({path:'/DoctorManagement' })
            })
        },
        quxaio(){
            this.$router.push({path:'/DoctorManagement' })
        }
    }
}
</script>

<style>

</style>